package com.bwie.controller;

import com.bwie.dto.TypeDto;

import com.bwie.service.TypeService;
import com.bwie.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* 商品分类表(tb_type)表控制层
*
* @author xxxxx
*/
@RestController
@Api(tags = "分类")
@RequestMapping("/good/type")
public class TypeController {
/**
* 服务对象
*/
    @Autowired
    private TypeService typeService;

    @ApiOperation("保存分类接口")
    @PostMapping("saveType")
    public R saveType(@RequestBody TypeDto typeDto){
        return typeService.saveType(typeDto);
    }

    @ApiOperation("列表分类树")
    @PostMapping("selectTypeTree")
    public R selectTypeTree(@RequestBody TypeDto typeDto){
        return typeService.selectTypeTree(typeDto);
    }

    @ApiOperation("字典分类树")
    @PostMapping("getTypeTree")
    public R selectTypeTree(){
        return typeService.getTypeTree();
    }
}
